package com.sq.partner.manager.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.ActirationCardCancelDao;
import com.sq.partner.manager.mybatis.model.ActirationCardCancel;
import com.sq.partner.manager.util.Page;

/**
 * 激活卡作废Dao实现
 * 
 * SQ
 *
 */
@Repository
public class ActirationCardCancelDaoImpl extends BaseDaoImpl implements
        ActirationCardCancelDao {

    @SuppressWarnings("unchecked")
    @Override
    public Page<ActirationCardCancel> queryPage(Page<ActirationCardCancel> page)
            throws Exception {
        Map<String, Object> paramMap = page.getMap();
        page.setTotal((Integer) this.query("queryCount", paramMap));
        page.setData((List<ActirationCardCancel>) this.queryList("queryList",
                paramMap));
        return page;
    }

    @Override
    public boolean updateCardCancel(HashMap<String, Object> paramMap)
            throws Exception {
        return this.update("updateCardCancel", paramMap);
    }

    @Override
    public boolean updateCardCancelBatch(HashMap<String, Object> paramMap)
            throws Exception {
        return this.update("updateCardCancelBatch", paramMap);
    }

    @SuppressWarnings("unchecked")
    @Override
    public Page<ActirationCardCancel> queryCancelPage(
            Page<ActirationCardCancel> page) throws Exception {
        Map<String, Object> paramMap = page.getMap();
        page.setTotal((Integer) this.query("queryCancelCount", paramMap));
        page.setData((List<ActirationCardCancel>) this.queryList(
                "queryCancelList", paramMap));
        return page;
    }

    @SuppressWarnings("unchecked")
    @Override
    public Page<ActirationCardCancel> queryCancelDetailPage(
            Page<ActirationCardCancel> page) throws Exception {
        Map<String, Object> paramMap = page.getMap();
        page.setTotal((Integer) this.query("queryCancelDetailCount", paramMap));
        page.setData((List<ActirationCardCancel>) this.queryList(
                "queryCancelDetailList", paramMap));
        return page;
    }
}
